<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions" %>
<!DOCTYPE html>
<html>
	<head>
		<meta name="viewport" content="initial-scale=1.0, maximum-scale=1.0, user-scalable=no" />				
		<meta charset="UTF-8">
		<title>形体检测评估</title>
		<link rel="stylesheet" href="${BASE_PATH}/static/app/css/reset.css" />
		<link rel="stylesheet" type="text/css" href="${BASE_PATH}/static/app/css/header.css"/>	
	    <link rel="stylesheet" href="${BASE_PATH}/static/app/css/bodyDetect.css" />
	    <link rel="stylesheet" href="${BASE_PATH}/static/app/css/bodyDetect1.css" />
	</head>
		<body>
		<div class="header">
			<span class="back" onclick="history.go(-1);"></span>
			<a href="/index"><span class="logo_pic"></span></a>
			<span class="logo_text">OK 妈咪</span>
		</div>
		<div class="title title-top">
			<h3 class="title-content">形体检测评估</h3>	
		</div>
		<div class="warp">
			<p>身高<span>${detect.sg }cm</span></p>
			<p>体重<span>${detect.tz }kg</span></p>
			<p>BMI值<span>${detect.bmi }</span></p>
			<p>脂肪含量(Fat%)<span>${detect.zfhl }</span></p>
			<p>基础代谢(BMR)<span>${detect.jcdx }</span></p>
		</div>
		<div class="title">
			<h3 class="title-content">尺寸测量<i>(每月检测1次)</i></h3>				
		</div>
		<div class="survey-time">
				<c:if test="${fn:length(sizelist) >0 }">
				<p>
					<c:forEach items="${sizelist }" var="size">
						<c:choose>
							<c:when test="${size.create_date == detectsize. create_date}">
								<span id="surveyOn">${size.create_date}</span>
							</c:when>
							<c:otherwise>
								<span>${size.create_date}</span>
							</c:otherwise>
						</c:choose>
					</c:forEach>
				</p>
				</c:if>
			</div>
		<div class="survey" id="survey">
			<div class="survey-content">
				<div class="survey-content-box">
					<p>脂肪含量</p>
					<span>${detectsize.zfhl }%</span>
				</div>
				<div class="survey-content-box">
					<p>基础代谢</p>
					<span>${detectsize.jcdx }</span>
				</div>
				<div class="survey-content-box">
					<p>BMI值</p>
					<span>${detectsize.bmi }</span>
				</div>
				<div class="survey-content-box">
					<p>脐上3寸</p>
					<span>${detectsize.qssc }cm</span>
				</div>
			</div>
			<div class="survey-content">
				<div class="survey-content-box">
					<p>脐中围</p>
					<span>${detectsize.qzw }cm</span>
				</div>
				<div class="survey-content-box">
					<p>脐下3寸</p>
					<span>${detectsize.qxsc }cm</span>
				</div>
				<div class="survey-content-box">
					<p>腰部脂肪厚</p>
					<span>${detectsize.ybzf }cm</span>
				</div>
				<div class="survey-content-box">
					<p>臀围</p>
					<span>${detectsize.tw }cm</span>
				</div>
			</div>
			<div class="survey-content">
				<div class="survey-content-box">
					<p>垂距</p>
					<span>${detectsize.cj }cm</span>
				</div>
				<div class="survey-content-box">
					<p>左上臀</p>
					<span>${detectsize.zsb }cm</span>
				</div>
				<div class="survey-content-box">
					<p>右上臀</p>
					<span>${detectsize.ysb }cm</span>
				</div>
				<div class="survey-content-box">
					<p>左大腿</p>
					<span>${detectsize.zdt }cm</span>
				</div>
			</div>
				<div class="survey-content">
				<div class="survey-content-box">
					<p>右大腿</p>
					<span>${detectsize.ydt }cm</span>
				</div>
				<div class="survey-content-box">
					<p>骨盆</p>
					<span>${detectsize.gp }cm</span>
				</div>
				<div class="survey-content-box">
					<p>检测人</p>
					<span>${detectsize.jcr }</span>
				</div>
				
			</div>
		</div>		
		<div class="body-detect">
				<h3>肥胖分型</h3>
			<div class="body-detect-content">
				<c:if test="${fn:contains(detect.fpfx,1)}"><span>AS型：上半身肥胖  </span></c:if>
				<c:if test="${fn:contains(detect.fpfx,2)}"><span>PA型：下半身肥胖  </span></c:if>
				<c:if test="${fn:contains(detect.fpfx,3)}"><span>BP型：上下直线型  </span></c:if>
				<c:if test="${fn:contains(detect.fpfx,4)}"><span>SI型：中部肥胖型  </span></c:if>
			</div>			
		</div>
		<div class="body-detect body-detect1">
				<h3>肥胖部位</h3>
			<div class="body-detect-content">
				<c:if test="${fn:contains(detect.fpbw,1)}"><span>背部</span></c:if>
				<c:if test="${fn:contains(detect.fpbw,2)}"><span>四肢</span></c:if>
				<c:if test="${fn:contains(detect.fpbw,3)}"><span>腹部</span></c:if>
				<c:if test="${fn:contains(detect.fpbw,4)}"><span>臀部</span></c:if>
				<c:if test="${fn:contains(detect.fpbw,5)}"><span>全身</span></c:if>
			</div>			
		</div>
	   	<div class="title">
			<h3 class="title-content">黄金周预估</h3>	
		</div>
		<div class="warp warp-tip warp-tipdetect">
			<p>${detect.hjzyg }</p>
		</div>
		<div class="title">
			<h3 class="title-content">生育性肥胖评估</h3>	
		</div>
		<div class="warp">
			<p>脂肪含量为<span>${detect.zfhl2 }%</span></p>
			<p>超出正常的百分比<span>${detect.cczgbfb }%</span></p>
			<p>产后体重自然下降值<span>${detect.chtzzyxj }kg</span></p>
			<p>标准体重<span>${detect.bztzyw }kg</span></p>
		</div>
			<!-- lib -->
		<script type="text/javascript" src="${BASE_PATH}/static/lib/jquery/jquery-1.11.2.min.js"></script>
		<script type="text/javascript" src="${BASE_PATH}/static/lib/template/template.js"></script>
		<script type="text/javascript" src="${BASE_PATH}/static/app/js/kit.js"></script>
		<script type="text/javascript">
		var pageNum = 0;
		$(".survey-time p span").on("click",function(){
			var date=$(this).html();
			Kit.ajax.post("${BASE_PATH}/my/myInfo/bodyDetectSize",{pageNum:pageNum+1,pageSize:1,date:date},function(result){
				$("#survey").empty();
				$("#survey").append(template("dataTpl",result.object));
			})
		})
		</script>
		<script type="text/html" id="dataTpl">
		{{each list as detects index}}
			<div class="survey-content">
				<div class="survey-content-box">
					<p>脂肪含量</p>
					<span>{{detects.zfhl }}</span>
				</div>
				<div class="survey-content-box">
					<p>基础代谢</p>
					<span>{{detects.jcdx }}</span>
				</div>
				<div class="survey-content-box">
					<p>BMI值</p>
					<span>{{detects.bmi }}</span>
				</div>
				<div class="survey-content-box">
					<p>脐上3寸</p>
					<span>{{detects.qssc }}cm</span>
				</div>
			</div>
			<div class="survey-content">
				<div class="survey-content-box">
					<p>脐中围</p>
					<span>{{detects.qzw }}cm</span>
				</div>
				<div class="survey-content-box">
					<p>脐下3寸</p>
					<span>{{detects.qxsc }}cm</span>
				</div>
				<div class="survey-content-box">
					<p>腰部脂肪厚</p>
					<span>{{detects.ybzf }}cm</span>
				</div>
				<div class="survey-content-box">
					<p>臀围</p>
					<span>{{detects.tw }}cm</span>
				</div>
			</div>
			<div class="survey-content">
				<div class="survey-content-box">
					<p>垂距</p>
					<span>{{detects.cj }}cm</span>
				</div>
				<div class="survey-content-box">
					<p>左上臀</p>
					<span>{{detects.zsb }}cm</span>
				</div>
				<div class="survey-content-box">
					<p>右上臀</p>
					<span>{{detects.ysb }}cm</span>
				</div>
				<div class="survey-content-box">
					<p>左大腿</p>
					<span>{{detects.zdt }}cm</span>
				</div>
			</div>
				<div class="survey-content">
				<div class="survey-content-box">
					<p>右大腿</p>
					<span>{{detects.ydt }}cm</span>
				</div>
				<div class="survey-content-box">
					<p>骨盆</p>
					<span>{{detects.gp }}cm</span>
				</div>
				<div class="survey-content-box">
					<p>检测人</p>
					<span>{{detects.jcr }}</span>
				</div>
				
			</div>
		{{/each}}
		</script>
		<script>
		/*尺寸测量月份选择点亮*/
			(function(){
				var surveys=document.querySelectorAll(".survey-time p span");
                for(var i=0;i<surveys.length;i++){
                	surveys[i].onclick=function(){
                		resets(surveys);
                		this.id="surveyOn";
                	}
                	
                }
                function resets(obj){
                	for(var i=0;i<obj.length;i++){
	                	obj[i].removeAttribute("id");
	                }
                }
			})()
		</script>
	</body>